# Contributor: Kevin Daudt <kdaudt@alpinelinux.org>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=nfpm
pkgver=2.37.1
pkgrel=0
pkgdesc="a simple apk, Deb and RPM packager without external dependencies"
url="https://nfpm.goreleaser.com/"
arch="all !riscv64"
license="MIT"
makedepends="go"
source="$pkgname-$pkgver.tar.gz::https://github.com/goreleaser/nfpm/archive/v$pkgver.tar.gz"

# secfixes:
#   2.35.2-r0:
#     - CVE-2023-49568

export GOFLAGS="$GOFLAGS -modcacherw"
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build -ldflags "-X main.version=$pkgver" -v -o nfpm ./cmd/nfpm/main.go
}

check() {
	go test
}

package() {
	install -Dm0755 nfpm "$pkgdir/usr/bin/nfpm"
}

sha512sums="
e8003e1cd4370de1b6ec0e8ef2b936d76dd60c3ed91b62366b072beb6f5d8cb54e67d115d26dbdb091a9336192301935b0c1ad364ec72619f1180c5b19bd4f09  nfpm-2.37.1.tar.gz
"
